﻿using System.Collections.Generic;

namespace DomainModel
{
    public class Subject : EntityBase
    {
        private IList<WorkType> _workTypes = new List<WorkType>();

        public virtual string Name { get; set; }
        public virtual int ModulesCount { get; set; }
        public virtual IEnumerable<WorkType> WorkTypes
        {
            get { return _workTypes; }
        }

        protected Subject()
        {
            _workTypes = new List<WorkType>();
        }

        public Subject(string name, int modulesCount)
            : this()
        {
            Name = name;
            ModulesCount = modulesCount;
        }

        public virtual void AddWorkType(WorkType workType)
        {
            if (!_workTypes.Contains(workType))
                _workTypes.Add(workType);
        }
    }
}
